<?php

namespace App\Request;

use Hyperf\Validation\Request\FormRequest;

class UserRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'username' => ['required', 'between:2,20'],
            'mobile' => ['required', 'between:1,6'],
        ];
    }

    public function attributes(): array
    {
        return [
            'username' => '账号',
            'mobile' => '手机号',
        ];
    }

    public function messages(): array
    {
        return [
            'username.required' => '用户名必填',
             'mobile.required' => '密码必填',
        ];
    }
}